package com.jsu.springboot_crop.service.impl;

import com.jsu.springboot_crop.dao.DiscussDao;
import com.jsu.springboot_crop.entity.Discuss;
import com.jsu.springboot_crop.service.DiscussService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DiscussServiceImpl implements DiscussService {
    @Autowired
    DiscussDao discussDao;
    @Override
    public List<Discuss> selectByKnowledgeId(Integer knowledgeId) {
        List<Discuss>discuss=discussDao.selectByKnowledgeId(knowledgeId);
        return discuss;
    }
    @Override
    public void add(Discuss discuss) {
        System.out.println(discuss);
        discussDao.insertSelective(discuss);
    }
}
